<?php 
if (isset($_GET["id"])) {
	if (isset($row)) {
	?>
		<ul class="nav nav-tabs nav-justified" onload="scope(); load_events(); date()">
			<li id = "nfo" class="active"><a onclick="displayClose('information','nfo','myArticles','myComments');">Informations</a></li>
			<li id = "myArts" <?php if(!$article) { echo 'class="hidden"'; } ?>><a onclick="displayClose('myArticles','myArts','information','myComments');">Articles</a></li>
			<li id = "myComs"><a onclick="displayClose('myComments','myComs','information','myArticles');">Commentaires</a></li>
		</ul>
		<div id = "information" class="main main-tabs clearfix" >
			<?php include_once('informations.html'); ?>
		</div>
		<div id = "myArticles" class="main main-tabs clearfix" style="display: none">
			<?php include_once('articles.html'); ?>
		</div>
		<div id = "myComments" class="main main-tabs clearfix" style="display: none">
			<?php include_once('commentaires.html'); ?>
		</div>
	<?php }
	else { ?>
		<div class="main">
			<div class="alert alert-danger center-block text-center half-size">
				Utilisateur invalide !
			</div>
		</div>
<?php }
} else { 
?>
    <div class="main">
        <div class="alert alert-danger center-block text-center half-size">
            Aucun utilisateur séléctionné !
        </div>
    </div>
<?php } ?>

<script type="text/javascript">

function replace(display,close)
{
	var divToClose = document.getElementById(close);
	divToClose.style.display = 'none';
	
	var divToDisplay = document.getElementById(display);
	divToDisplay.style.display = 'block';
}

function displayPage()
{
	var divs = new Array('information','myArticles','myComments');
	var tabs = new Array('nfo','myArts','myComs');
	var i;

	for (i=0; i < 3; i++) {
		if (divs[i] == '<?php if(isset($_GET["page"])) { echo $_GET["page"]; } ?>') {
			var divToDisplay = document.getElementById(divs[i]);
			divToDisplay.style.display = 'block';

			var divActive = document.getElementById(tabs[i]);
			divActive.className = "active";
		}
		else {
			var divToClose = document.getElementById(divs[i]);
			divToClose.style.display = 'none';

			var divActive = document.getElementById(tabs[i]);
			divActive.className = "";
		}
	}
}

function displayClose(display, active)
{

	var divs = new Array('information','myArticles','myComments');
	var tabs = new Array('nfo','myArts','myComs');
	
	for(var i =0; i <3; i++)
	{
		if(tabs[i] == active)
		{
			document.getElementById(active).className = 'active';
		}
		else
		{
			document.getElementById(tabs[i]).className = '';
		}
		
		if(divs[i] == display)
		{
			document.getElementById(display).style.display = 'block';
		}		
		else
		{
			document.getElementById(divs[i]).style.display = 'none';
		}
	}
	
	<?php if(!$article) { ?>

	document.getElementById(tabs[1]).className = "hidden";
	<?php } ?>
}

<?php if (isset($_GET["page"])) { ?>
	window.onload = displayPage;
<?php } ?>
</script>